import request from '@/utils/request'

// 必须实现的方法 - 根据id查询记录
export const getDepartmentById = (id) =>
  request({
    url: `/org/department/${id}`,
    method: 'get'
  })

// 必须实现的方法 - 分页查询
export const listDepartmentPage = (search) =>
  request({
    url: '/org/department/list',
    method: 'post',
    data: search
  })

// 必须实现的方法 - 查询所有记录
export const listDepartmentAll = (search) =>
  request({
    url: '/org/department/listAll',
    method: 'post',
    data: search
  })

// 必须实现的方法 - 树形结构查询
export const treeDepartment = (search) =>
  request({
    url: '/org/department/tree',
    method: 'post',
    data: search
  })

// 必须实现的方法 - 保存/更新记录
export const saveDepartment = (department) =>
  request({
    url: '/org/department/save',
    method: 'post',
    data: department
  })

// 必须实现的方法 - 删除记录
export const deleteDepartment = (department) =>
  request({
    url: '/org/department/delete',
    method: 'post',
    data: department
  })

// 必须实现的方法 - 批量保存/更新记录
export const bulkInsertDepartment = (departments) =>
  request({
    url: '/org/department/bulkInsert',
    method: 'post',
    data: departments
  })

// 必须实现的方法 - 批量更新记录
export const bulkUpdateDepartment = (departments) =>
  request({
    url: '/org/department/bulkUpdate',
    method: 'post',
    data: departments
  })

// 必须实现的方法 - 批量删除记录
export const bulkDeleteDepartment = (departments) =>
  request({
    url: '/org/department/bulkDelete',
    method: 'post',
    data: departments
  }) 